<template>
  <div class="Head_top">
    <div class="tu" >
       <img src="../../assets/back.png" alt="" @click="back" /> 
    </div>
    <div class="right">
      <!-- <h3>
        <slot></slot>
        {{ title }}
      </h3> -->
      <slot></slot>
      {{ title }}
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: "",
    },
    backUrl: {
      type: String,
      default: "",
    },
  },
  methods: {
    //返回上一级
    back() {
      this.$emit("back");
      if (this.backUrl) {
        this.$router.push({
          path: this.backUrl,
        });
      } else {
        this.$router.go("-1");
      }
    },
  },
};
</script>

<style scoped>
.Head_top {
  width: 100%;
  display: flex;
  padding: 0.06rem 0;
  background-color: white;
  position: sticky;
  top: 3.12rem;
  left: 0;
  overflow-y: overlay;
  z-index: 999;
  font-family: SimSun;
  font-weight: bold;
  /* border-bottom: 2px solid #dad9df; */
}
/* 文字设置宋体 */
@font-face {
  font-family: SimSun;
  src: url("../../family/songti.ttf");
}
/* 返回区域 */
.Head_top .tu {
  width: 5%;
  height: 0.32rem;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-left: 2px;
  /* margin-left: .1rem; */
}
.Head_top .tu img {
  width: 0.1rem;
}
/* 文字区域 */
.right {
  width: 90%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;

  margin-left: 0.08rem;
  font-size: 0.22rem;
}
.right .title-icon {
  width: 0.24rem;
  margin-right: 0.05rem;
}
.Head_top h3 {
  width: 100%;
  height: 100%;

  display: flex;
  font-size: 0.17rem;
  align-items: center;
  justify-content: center;
}
/* .top .wen img{
  width: 0.23rem;
  margin-right: 0.05rem;

} */
</style>